      <form action="<?php echo url::base() ?>discussions/edit_add/<?php echo $discussion->id ?>" method="post">
      <section id="content">
        <div id="content-left-box">
          <div class="content-left">
            <h2>Diskuze</h2>
            <ul class="menu">
              <li class="active"><a href="<?php echo url::base(); ?>discussions/add" title="přidat nové téma">Přidat téma</a></li>
              <li><a href="<?php echo url::base(); ?>discussions/my" title="Mé diskuze">Mé diskuze</a></li>
            </ul>
            <div class="content-left-bottom menu-left-bottom"></div>
          </div>
          <div class="content-left">
            <h2>Kategorie</h2>
            <div class="content-left-main">
              <select name="category" style="width:157px;">
                <?php foreach ($cat as $cat_item): ?>
                <option value="<?php echo $cat_item->id ?>" <?php if ($discussion->category == $cat_item->id) {echo 'selected="selected"';} ?>><?php echo $cat_item->name ?></option>
                <?php endforeach ?>
              </select>
            </div>
            <div class="content-left-bottom"></div>
          </div>          
        </div>
        <div class="content-right">
          <header>
            <h2>Upravit téma - <?php echo $discussion->title ?></h2>
          </header>
          <section>
          <div id="big">
          <?php if (! empty($discussion->locked)): ?>
              Tento článek byl publikován a není možné ho již změnit.
            <?php else: ?>
            <fieldset>
              <ul class="big">
                <li>
                  <label for="title">Nadpis:</label>
                  <input id="title" type="text" name="title" value="<?php echo $discussion->title ?>" class="text" />
                </li>
                <?php if (Auth::instance()->logged_in('admin')): ?>
                <li>
                  <label for="seo_title">SEO url:</label>
                  <input id="seo_title" type="text" name="seo_title" value="<?php echo $discussion->seo_title ?>" class="text" />
                </li>
                <?php endif ?>
                <li>
                  <label for="tinymce">Text:</label>
                  <div class="text">
                    <textarea cols="10" rows="10" id="tinymce" name="text" class="transparent"><?php echo $discussion->text ?></textarea>
                  </div>               
                  <span class="button-textarea float-right"><a href="javascript:;" onmousedown="tinyMCE.get('tinymce').hide();">HTML</a></span>
                  <span class="button-textarea float-right"><a href="javascript:;" onmousedown="tinyMCE.get('tinymce').show();">Editor</a></span>                  
                </li>
                <li></li>
                <li>
                  <input class="float-right" type="submit" name="form-submit" value="Upravit téma"  />
                </li>
              </ul>
            </fieldset>
            </div>
          </section>
          <div class="content-right-bottom"></div>
          <?php endif ?>
        </div>
      </section>
      </form>
      <script type="text/javascript">
        $(document).ready(function() {
          
          tinyMCE.init({
            // General options
            mode : "textareas",
            language : "cs",
            height : "200",
            convert_urls : true,
            relative_urls : false,
            remove_script_host : false,
            document_base_url : "<?php echo url::base(); ?>",

            // General options
            theme : "advanced",
            skin: "pv_skin",
            inlinepopups_skin: "pv_skin",
            theme_advanced_resizing_max_width : 440,
            theme_advanced_resizing_min_height : 200,

            plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",

            // Theme options
            theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,|,bullist,numlist,fontsizeselect,link,unlink,removeformat,undo,redo,fullscreen,preview",
            theme_advanced_buttons2 : "",
            theme_advanced_buttons3 : "",
            theme_advanced_toolbar_location : "top",
            theme_advanced_toolbar_align : "left",
            theme_advanced_statusbar_location : "bottom",
            theme_advanced_resizing : true,

            // Drop lists for link/image/media/template dialogs
            external_image_list_url : "/files/upload_img_view/"
          });          
      });
    </script>